<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>权限环节添加</title>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<script type="text/javascript" src="../static/js/easyui/jquery-1.4.2.min.js"></script>
<script>
$(document).ready(function(){
	$("#apparatus").change(function(){
		var checkValue=$("#apparatus").val();
		$.ajax({
		   type: "POST",
		   url: "./index.php?file=workflow&action=addRole&nocache=${time()}&apparatusid="+checkValue,
		   success: function(html){
			  $("#departmentuser").html(html);
		   }
		});
	});
	$("#departmentuser").change(function(){
		var checkValueDepartmentuser=$("#departmentuser").val();
		$.ajax({
		   type: "POST",
		   url: "./index.php?file=workflow&action=addRole&nocache=${time()}&departmentuserid="+checkValueDepartmentuser,
		   success: function(html){
			  $("#userlist").html(html);
		   }
		});
	});
	$("#userlist").change(function(){
		var checkValueUserlist=$("#userlist").val();
		var checkValueUserlistName = $("#userlist").find("option:selected").text();  
		$("#roleid").val(checkValueUserlist);
		$("#rolename").val(checkValueUserlistName);
	});
});

function setDataRoleId() {
	var roleid = $("#roleid").val();
	var rolename = $("#rolename").val();
	window.opener.setData (roleid,rolename);
	self.close();
}
</script>
<body>
<table width="689" height="242" border="0">
  <tr>
    <td height="46" colspan="6"><span class="STYLE1">说明：添加规则时，请先选择机构，在选择部门，完后选择参与人员（人员如是多人参与项目按主Ctrl在尽行多选，如果这些人员是协同办公必须同时处理此项任务，请在协同上打钩）<br />特殊人士：这些人可能管理好多机构，部门，但是他们不算其中任何一个部门或者机构，对于这些人，我们定位于特殊人士</span></td>
  </tr>
  <tr>
    <td width="116" height="46">选择机构：</td>
    <td width="152"><select name="select" size="2" id="apparatus">
	<!--{loop $apparatus $r}-->
      <option value="{$r['jid']}">{$r['names']}</option>
	<!--{/loop}-->
    </select></td>
    <td width="92">选择部门：</td>
    <td width="79"><select name="select2" size="2" id="departmentuser">
    </select></td>
    <td width="123">选择参与人员：</td>
    <td width="101"><select name="select3" size="2" multiple="multiple" id="userlist">
    </select></td>
  </tr>
  <tr>
    <td height="46" colspan="6">参与人员名：
    <input id="rolename" type="text" size="70" readonly/>
    <input type="checkbox" name="checkbox" value="checkbox" />
协同</td>
  </tr>
  <tr>
    <td height="46" colspan="6">参与人员：
    <input id="roleid" type="text" size="70" readonly/></td>
  </tr>
  <tr>
    <td height="46" colspan="6">特殊人士：<input type="checkbox" id="" /><span id="">张三</span>&nbsp;&nbsp;<input type="checkbox" id="" />张三</td>
  </tr>
  <tr>
    <td height="46" colspan="6"><div align="center">
      <input type="submit" name="Submit" value="选择完毕" onclick="setDataRoleId()"/>
    </div></td>
  </tr>
</table>
</body>
</html>
